import request from '@/config/axios'

export interface DirawingInventoryVO {
  orderNumber: string
  dictOrderType: number
  customerName: string
  customerCode: string
  productCode: string
  productName: string
  productSpec: string
  inventoryVersion: object
  dictDrawingType: byte
  creatorName: string
  updaterName: string
}

// 查询技术管理-图纸制作-图纸清单列表
export const getDirawingInventoryPage = async (params) => {
  return await request.get({ url: `/technology/dirawing-inventory/page`, params })
}

// 查询技术管理-图纸制作-图纸清单详情
export const getDirawingInventory = async (id: number) => {
  return await request.get({ url: `/technology/dirawing-inventory/get?id=` + id })
}

// 新增技术管理-图纸制作-图纸清单
export const createDirawingInventory = async (data: DirawingInventoryVO) => {
  return await request.post({ url: `/technology/dirawing-inventory/create`, data })
}

// 修改技术管理-图纸制作-图纸清单
export const updateDirawingInventory = async (data: DirawingInventoryVO) => {
  return await request.put({ url: `/technology/dirawing-inventory/update`, data })
}

// 删除技术管理-图纸制作-图纸清单
export const deleteDirawingInventory = async (id: number) => {
  return await request.delete({ url: `/technology/dirawing-inventory/delete?id=` + id })
}

// 导出技术管理-图纸制作-图纸清单 Excel
export const exportDirawingInventory = async (data) => {
  return await request.download({ url: `/technology/dirawing-inventory/export-excel`, data })
}

//技术管理-图纸制作-图纸清单-详情-版本号详情
export const getInventoryVersion = async (id) => {
  return await request.get({ url: `/technology/dirawing-inventory-detailed-history/versionList?detailedId=` + id })
}